<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk">
    <body>
        <ui:composition template="/MenuTemplate_wave.xhtml">
             <ui:define name="content_nav">
                   #{msg.content_nav_usermanage}
                </ui:define>
            <ui:define name="content">
                <h:messages globalOnly="true"
                            infoClass="info"  errorClass="alert"
                            fatalClass="colorOrange" /> 
                <h:panelGrid  styleClass="body_content_box" columns="1">
                    <h:form id="userAddForm">
                        <h:panelGrid styleClass="search_border" columns="1" cellpadding="0" cellspacing="0">
                            <h:panelGrid styleClass="search_title" columns="1" cellpadding="0"
                                         cellspacing="2">
                                <h:outputLabel value="#{msg.content_title_user_add}"  style="vertical-align: middle"/>
                            </h:panelGrid>
                            <h:panelGrid columns="1" style="width: 100%" border="0" cellpadding="3" cellspacing="0">
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 75px">
                                        <h:outputLabel value="#{msg.label_user_name}" ></h:outputLabel>
                                    </h:panelGrid>
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 100px">
                                        <h:inputText id="username" value="#{userListBean.userName}" required="true"></h:inputText>
                                    </h:panelGrid>
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" >
                                        <h:message for="username"/>
                                    </h:panelGrid>
                                </h:panelGrid>
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 75px">
                                        <h:outputLabel value="#{msg.label_user_domain}"></h:outputLabel>
                                    </h:panelGrid>
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 100px">
                                        <h:selectOneMenu id="domains" value="#{userListBean.domainId}">
                                            <f:selectItems value="#{userListBean.domainList}"/>
                                    </h:selectOneMenu>
                                    </h:panelGrid>
                                    <h:message for="domains" errorClass="colorRed"/>
                                </h:panelGrid>
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 75px">
                                    <h:outputLabel value="#{msg.label_user_role}"></h:outputLabel>
                                    </h:panelGrid>
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 100px">
                                    <h:selectOneMenu id="roles" value="#{userListBean.roleId}">
                                        <f:selectItems value="#{userListBean.roleList}"/>
                                    </h:selectOneMenu>
                                    </h:panelGrid>
                                    <h:message for="roles" errorClass="colorRed"/>
                                </h:panelGrid>
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 75px">
                                    <h:outputLabel value="#{msg.label_user_passwd}"></h:outputLabel>
                                    </h:panelGrid>
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 100px">
                                    <h:inputSecret id="passwd" value="#{userListBean.passWord}" required="true"/>
                                    </h:panelGrid>
                                    <h:message for="passwd" />
                                </h:panelGrid>
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 75px">
                                        <h:outputLabel value="#{msg.label_user_chinese_name}"></h:outputLabel>
                                    </h:panelGrid>
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 100px">
                                        <h:inputText id="userChName" value="#{userListBean.userChName}" required="true"/>
                                    </h:panelGrid>
                                    <h:message for="userChName" />
                                </h:panelGrid>
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 75px">
                                    <h:outputLabel value="#{msg.label_user_position}"></h:outputLabel>
                                    </h:panelGrid>
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 100px">
                                    <h:inputText id="position" value="#{userListBean.position}" required="true"/>
                                    </h:panelGrid>
                                    <h:message for="position" />
                                </h:panelGrid>
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 75px">
                                    <h:outputLabel value="#{msg.label_user_phone}"></h:outputLabel>
                                    </h:panelGrid>
                                    <h:panelGrid cellpadding="0" cellspacing="0" border="0" style=" width: 100px">
                                    <h:inputText id="phoneNo" value="#{userListBean.phoneNo}" required="true"/>
                                    </h:panelGrid>
                                    <h:outputText/>
                                </h:panelGrid>
                                <h:panelGrid cellspacing="0" cellpadding="0">
                                    <h:commandButton value="#{msg.bt_add}" action="#{userListBean.addUser}"/>
                                </h:panelGrid>
                            </h:panelGrid>
                        </h:panelGrid>
                    </h:form>
                </h:panelGrid>

            </ui:define>
        </ui:composition>
    </body>
</html>